News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

SM Level Data Pointers - Bug or feature?

Started by HeartOfGermany, October 11, 2017, 04:50:36 PM

Previous topic - Next topic

HeartOfGermany

Hello folks. Don't get me wrong, I am not asking for help here. I just want to understand something technical that realy confuses me and grinds on my mind.



I might try a Redesign suitless any time soon. For that I needed a tile-perfect map of all underwater rooms to find a route - pretty difficult thing, not yet sure if it even is possible.


So now on topic:

I entered a room and pressed Ctrl+E and spawned in the game with no problem as usually expected. Why only usually? Well, as many of the more moderate modders in here know, if you open redesign in SMILE it either shows crap or just black tiles.

I entered the RAM Pointer for the level data to the room-state pointers and sure, it properly showed the room in SMILE.

Now it gets very interesting and that grinds my mind:

If you now hop into the game, it totally glitches up the level information and you spawn in total crap, even thought SMILE shows a perfectly clean room. I mean, if neccesary you could just add the old pointer back to the room-state pointers and play in the changed room, but that is not the question here.


I only want to understand the technical thing that causes it to EITHER work in SMILE or ingame. Should it not all the time work in both cases or not work in both cases? o.O

It is a few years, since I modded HEX data and pointers, but I remember, if I am not wrong, that you can point to a pointer to a pointer to a pointer to the real stuff (data, code etc...).

But I hopped back to it a bit and just wanted to know, where I will land with Lunar LoROM<->PC. I did either find blank space or was in the middle of code.

This makes no sense to me. I guess it might have to do with the banks, because this large hack saves level data outside of the first 3MB ($BD / 189 banks?). I am not that sure and not willing to spend much time on hacking at all, so if someone could explain that odd behavior to me, it would be great.

I remember (EDIT: this was years ago /edit), that I in fact did manage to save level data after the first 3/4 banks. I am not sure, i have to admit, if it only worked in SMILE or also in the game. Maybe it has to do with that?


I did not want to ask, but this question does not get out of my head, please make me sleep peacefully again.  :lol:


Thanks, ladies and gentleman!  :^_^:

Smiley

I don't know the details, but from what I know, Drew changed how level data is stored and loaded in Redesign. But because SMILE expects level data to be in a specific format, it cannot display Redesign's rooms properly. If I remember correctly, all the level data is simply XOR'd in Redesign.

HeartOfGermany

No, the Level Data is just fine. SMILE can read the Redesign Level Data - you need to however change the Level Data Pointer to the ID in the RAM - it is, like the game does not work with the same pointer system like smile. Smile can only read the ingame Pointer, you find in the RAM, but not the Pointer, every room header in the hack has, that smile shows you (and it loads basically the wrong data, that's why it looks like crap. But why can the game read that wierd pointer, that seems to make no sense at all?

P.JBoy

Level data pointers are saved in a different format in Redesign, one that's incompatible with SMILE, there's nothing more to it. You can of course overwrite the level data pointer with one that SMILE understand, and have it break in emulator; the only trickery is that Redesign has an ASM hack that changes how the level data pointer is processed
...

HeartOfGermany

Thanks a lot. That I wanted to know. Yeah, I guess it is like a Copy protection. I don't realy get, why, because this only protects the rooms - the things no one would copy are rooms, I think.

I think it would have been much better, to just protect the Tiles, because that would be an easy rip just with SMILE.


But awesome to know, that someone went through that much of trouble to make rooms unreadable. :D

benox50

#5
I think he wanted that to protect his hack from being edited and resend with edits that arent made by him.
But that kind of illegal asset flip will rarely occur on a well known well made hack without being noticed, so Drew made people that want to polish his hack to make it better hard to do.

I personally dont know if someone taking a hack then edit it a little and repost it with him as the author ever happened, it probably happened on a small bad hack that nobody care. However doing this is disgusting and Drew wanted a way to protect his work from that.

HeartOfGermany

Well, though I don't think someone will do that, I absolutely understand that move. Even though the Level is the only protected thing, it might look to someone like "Shit, I broke the hack, better not play around here."

Also it is an early hack and therefore I absolutely understand this and might have done something similar in his place.

The only thing I don't understand 100%: Did he realy manually change all the Room Level Data Pointers by hand, after he finished or did he use a custom SMILE version? Are there any data recorded on this?

I mean, there are so many many many rooms and repointing them all by hand and than he has to play through to test if every roomstate works properly seems a huge "time monster".

P.JBoy

A custom version of SMILE. Although Drewseph is definitely the sort of person that would do it by hand if necessary anyway; after all, doing that would have nothing on the amount of time spent actually making the rooms themselves
...

HeartOfGermany

Yeah, I am totally with you on that. He propably would have manually repointed everything if neccesary or would use something different to archive something similar.

After all he had great help on the coding site!  :cool:


And yeah... I hardly can imagine how much time went into that hack. After all the ASM changes are soooo many. Many of the changes, that look just like a simple variable change are often linked to a lot of ASM.

Years ago I did read through the IPS Patch logfile and was blazed at all the changes - not just the rooms at the end, all the lines of code (I only saw the hex of course). I did even manage to partially reverse engineer some stuff like the re-Shinespark and the re-spin and it was buggy.

After all, I don't realy like to copy stuff, so I stopped, knowing I could never spent that much time on something of that size ever! I realy respect Drew, Grime, MST and all the great hackers out there and sometimes I get amazed even again finding out new changes and details.

I mean, before hacking, who knew there was a scrolling sky fix? Who even knew, there was a glitch with it? :D

Yeah, respect for that.

Would love to see a Super Metroid remake for PC with exactly same or very similar physics (and of course glitches and all the details like damage boost etc.), though Nintendo would be hell of a d*ck like with AM2R which realy is amazing work.

Drewseph

Feature.  I intentionally scrambled the pointers for level data thanks to a special version of SMILE Jathys made for me. Axeil is unlocked though and free to look through.