-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Record some stage hazards in new events #125
base: master
Are you sure you want to change the base?
Conversation
Keep in mind that you'll want to increase the possible total length of the transfer buffer. The symbol for that is As for the changes themselves... I'm a bit torn. I don't know whether it's worth increasing the file size for this or not. What do you want to use it for? A preview display like slippilab.com? |
I'm looking into doing some auto match analysis (like auto coaching). I got the motivation to work on it when I saw it was an issue on slippilab. It would also be useful for AI to understand where the platforms are. The affect on file size is very small. It only affects 1/6 stages, only runs on frames where the platform changes (conservative estimate 1/20 of the time), doesn't run for each fighter, and each event is only 6 bytes. 1 byte in post frame update would have a way larger affect on file size. Wispy info would be even smaller. Edit: Also is file size a major limitation right now? Disk space is really cheap, and replays can be compressed 10-20x easily |
Good to know about the frequency, that helps ease my concerns. File size is somewhat of a concern but small amounts won't impact much. Some people start to fill out all the free space in their discs, larger files are just a bit more frustrating for users. Do you know which messages it gets sent between? Also I noticed that you didn't include the frame index in the payload, are you expecting to gather the frame index from messaging order? While I suppose that would work it's not necessarily guaranteed by the spec. Though given we have a frame start and frame end message now, maybe it should be? |
I added the frame index. I think it makes sense to have it. Currently it runs between pre and post frame updates. However... It also runs once for each platform initially after gecko codes and before the first frame. I expected this might happen, but I hoped the |
Maybe you can check the scene frame? |
I added a new code to record whispy's blowing direction. I statically store the previous direction and avoid sending an event unless it changes. This event also runs between pre and post frame updates. |
# We skip to avoid the two initialization calls at game start | ||
mflr r0 | ||
load r3, 0x801cc908 | ||
xor. r0, r0, r3 | ||
beq Skip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# We skip to avoid the two initialization calls at game start | |
mflr r0 | |
load r3, 0x801cc908 | |
xor. r0, r0, r3 | |
beq Skip | |
# We skip to avoid the two initialization calls at game start | |
loadGlobalFrame r3 | |
cmpwi r3, 1 | |
ble Skip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer this over checking the LR, checking the LR feels quite hacky compared to checking the scene frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried this, but it doesn't work. The scene frame value is 0x000000d8 for the initial two calls. Maybe I could skip on that value, but can a platform try to move that soon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah you're right I was testing with a replay and the behavior is different. It looks like the function gets called in the previous scene. So 0xd8 was just the frame on the SSS that you selected FoD. We might be able to check if we're in an in-game scene instead... lemme check some stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you confirm that FN_ShouldRecord
did not work? I feel like it might.
EDIT: Yeah it looks like the scene has changed but the scene frame has not reset, that's kinda wild
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm thinking now that maybe the best plan is to add the following to SendGameInfo.asm
li r3,CONST_FirstFrameIdx
stw r3,frameIndex(r13)
That way you know that the value has been initialized to the first frame and you can just use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really much safer to modify the scene frame counter? I agree checking the LR is hacky, but I can't think of a way it would break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super late to this but that frameIndex is not the scene frame counter. That's Slippi's frame counter that starts at -123. Overwriting it there should be completely safe, nothing else in the game uses that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it this way and it worked.
I added a final event to send stadium transformation events. Here's an example plot of the ID values over the course of a replay:
Right now the code sends red+green whenever either one changes. If we sent only red, you could logically reconstruct the green. However, it involves knowing and adding multiple different frame constants. |
Would an event code of 0x3E cause problems with this?: https://github.com/project-slippi/Ishiiruka/blob/7d88fa472119c63a61b0842d3ca439cc1af078b8/Source/Core/Core/HW/EXI_DeviceSlippi.h#L56 |
What would it take to push this through? This is required for vod reconstructors. Willing to do some work if necessary. |
This PR is pretty much done, but there are a few considerations:
Thank you for your interest. |
I've implemented FOD platforms in my reconstructor using this, and so far it looks good to me.
|
Implemented transformations. The PS transformation representation looks good to me. I didn't end up using the subaction ids. You need to match over It would be nice to record the y-scale of the current transformation when it changes. It wasn't super difficult to reverse engineer the y-scaling, but recording it would make mine and other's lives a little easier. The easiest to use representation would only store the frame, the transformation id, and the y-scale. But this loses information when compared the existing representation and would require an implementation overhaul, so I think the current representation is fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea what I'm looking at, but carpe diem
Any thoughts on how to proceed here? Should we rethink the implementation? Should we record more hazards? Just looking for some clarification on why this can't be merged in. This is very big for vod reconstructors. |
Draft PR as I plan to add something similar for DL's wispy and PS's transforms. Let me know if this looks like a decent idea.I finished adding events for the competitive stages.