News:

11 March 2016 - Forum Rules

Main Menu

Would this be possible?

Started by therealtaftq, February 03, 2022, 11:43:58 PM

Previous topic - Next topic

therealtaftq

Hey. I'm the guy who made that Sonic in SMB1 hack from a couple weeks ago, and I had an interesting idea for a mechanic for it.
This is probably gonna sound completely insane, but I'm thinking of adding rolling to the hack. Would that actually be possible? I doubt it, but I do have a general idea of what I'd have to do to get it to work:
1. Remove the deceleration from crouch sliding (or decrease the traction, depending on how they did it)
2. Make Mario/Sonic use a unique sprite for crouch sliding (the jump sprite, in this case)
3. Make Mario/Sonic deadly to the touch when crouch sliding (maybe have them mimic a Koopa shell's behavior?)

I don't have much experience with this kind of stuff, so I'm not sure exactly how difficult implementing something like this would be (or if it would even be possible), but it doesn't seem too far-fetched, IMO. I'll need a second opinion from someone who actually knows what they're doing to be sure, though.

P.S. I'm having trouble figuring out where Mario's collision is in the code. If someone can at least give me a general idea of where it is in hex form (I'm using a hex editor), then I should be able to figure out what to do from there. Thanks in advance!

N·K

Quote from: therealtaftq on February 03, 2022, 11:43:58 PM
P.S. I'm having trouble figuring out where Mario's collision is in the code. If someone can at least give me a general idea of where it is in hex form (I'm using a hex editor), then I should be able to figure out what to do from there. Thanks in advance!

The collision coordinate data between Mario and the terrain is located at $63b0-$63e7.
For SMBDis, this corresponds to BlockBuffer_X_Adder and BlockBuffer_Y_Adder.


FAST6191

You are thinking rather more high level/design document style than most hackers will approach things, and most NES games are coded as, but seem to be on the right path in that regard.

"a general idea of where it is in hex form (I'm using a hex editor)"
Finding such locations is a) what making hacks about (thinking up means and things that will be able to be found that are related and working backwards/forwards to that point) and b) using a hex editor like I imagine you are is a backwards way of setting about it. Not to mention you have a disassembly in this case to look at https://gist.github.com/1wErt3r/4048722

For instance
1. So the deceleration is part of the X location (possibly also Y but definitely X), be it in OAM, https://docs.google.com/document/d/1iNSQIyNpVGHeak6isbP6AHdHD50gs8MNXF1GCf08efg/pub sense, or in the more virtual level location sense (easily found with cheats by... moving). Whatever changes this will have any deceleration be a factor in things. Now you have your in for something to look at.
2. Hopefully there is some free space in the memory and ROM for something extra, or you can work around that. Otherwise seems like a fairly basic IF one state then show this, if another state then show another.
3. This might involve hitboxes and priorities (some of which could be fun if the base game does not give the player a top priority slot, though this might be an idea -- plenty of things in sonic you can't just spindash and kill, Mario's spinys, the red things with orange spikes that cloud guys chuck down in later levels for those playing along at home, even looking like some of those and being conceptually similar*.

*granted most of those in Sonic tend to be more of a timing, dodge if you are going fast, and/or approach from given direction.

therealtaftq

Thanks for the help! I think N- K's answer is what I needed. Time to screw around until I find the right value!

therealtaftq

Hey. I just thought I'd let you know how things are going. I managed to get the jump collision to work the way I want it to.
Unfortunately, it's causing some glitches.
Here's a comparison between the original code and my modified code:

Original code:
$04, $20, $20, $08, $18, $08, $18, $02
$20, $20, $08, $18, $08, $18, $12, $20
$20, $18, $18, $18, $18, $18, $14, $14
$06, $06, $08, $10

Modified code (changed values in italics):
$10, $20, $20, $10, $18, $10, $18, $02
$20, $20, $10, $18, $10, $18, $12, $20
$20, $18, $18, $18, $18, $18, $14, $14
$06, $06, $08, $10

Glitches include the following:
Sonic losing his momentum upon hitting a block
Sonic shifting to the side slightly upon hitting a block while standing still
Sonic phasing through bricks near the top of the screen instead of breaking them

Can someone help figure out what's going wrong here and how I can fix it? Thanks in advance!

Update: Changing all added 10s after the first one seems to have mostly fixed everything. The third problem still persists, though. This also has the consequence of Sonic being able to enter 1-block gaps without crouching. If someone can figure out how to fix these issues without causing new ones, I'd appreciate it.

Cyneprepou4uk

What are you even talking about? You just showing us some random bytes and asking what's wrong with them.

If that's a part of one of your previous topics, why don't you continue posting there?

N·K

This is a reply to a question in this thread.

Please refer to the following.
Using the upper left corner of the sprite as the origin, it seems to be examining the blocks that are in contact with each of Mario's positions.


BlockBuffer_Y_Adder:
;        |Head |Feet     |Side
      .db $04,  $20,$20,  $08,$18,$08,$18  ; big mario
      .db $02,  $20,$20,  $08,$18,$08,$18  ; big mario(underwater)
      .db $12,  $20,$20,  $18,$18,$18,$18  ; small mario

      .db $18,$14,$14,$06,$06,$08,$10      ; enemy,item,fireball,etc.


Quote from: therealtaftq on February 06, 2022, 01:45:53 AM
Sonic phasing through bricks near the top of the screen instead of breaking them

Maybe you should edit $5c62 (PlayerBGUpperExtent in the case of SMBDis) to an arbitrary value.

Quote from: therealtaftq on February 06, 2022, 01:45:53 AM
This also has the consequence of Sonic being able to enter 1-block gaps without crouching.

That's because his height has shrunk.

therealtaftq

Hey. I actually already fixed everything by replacing the first 10 with 0a and the rest with 0f. There's still a minor glitch involving interaction with bricks, but everything else seems to be fixed now.

KingMike

Don't make an "update" thread. Just post to the same thread.
"My watch says 30 chickens" Google, 2018

ThroughT1m3

"Keep dodging lights, like a thief in the night. The sun will rise and expose all our lies. So why deny that you and I lead different lives? The rivers from your eyes can't change my mind"

Hulta

2. Make Mario/Sonic use a unique sprite for crouch sliding (the jump sprite, in this case) well that would be good i think.