Asunaya / RefinedGunz

103 stars 48 forks source link

Running Freestyle Gunz replays #19

Closed phugen closed 6 years ago

phugen commented 7 years ago

Hi,

first of all: Your work is really inspiring. I stumbled across this repository randomly while trying to find a way to rip the Gunz maps as 3D objects and ended up using your Server/Client setup for it, and it worked terrificly. Also, all Gunz movie makers should love you for the long-needed (!) rewind/forward feature for replays.

My "issue" is more of a question and is not really an issue with your code: While I guess that playing back Freestyle Gunz replays theoretically works (as in that the header they use is parsed correctly etc), in practice, the game crashes when you run them. I suspect this is simply because FGunz uses a number of custom weapon and clothing models.

Because it's unlikely I'll get my hands on these models as FGunz switched from the traditional .mrs archives to their own, likely encrypted, ".fgz" format, is there a way to define defaults for missing models, e.g. fall back to the Golden Dragon sword model in case a sword model couldn't be loaded? Or is there a much simpler solution I haven't thought of?

Thanks in advance!

Asunaya commented 7 years ago

Could you post the replay files with which you're having issues?

phugen commented 7 years ago

Sure, here: https://my.mixtape.moe/gvfufz.gzr

At least one character in the game ("Mirrored") is carrying a sword that's definitely not included in the standard GunZ .mrs files, so that might be what's crashing it.

Asunaya commented 7 years ago

Thanks.

The actual issue turned out to be that, since I haven't looked at Freestyle Gunz replays in a while, they have, in the intervening time since I wrote that code, added a new replay format: V10. Since I wrote the heuristics under the assumption that the only legal FG versions were 7 through 9, the game instead thought it was an Aeria Gunz replay.

Regarding the items: Replays store just integral IDs for every item. The IDs map to information in the zitem.xml in system.mrs.

However, since the IDs in the RG zitem.xml differs from the FG ones, the items aren't recognized at all. That is, not only do custom items that don't exist on RG not load, shared items do generally not load either, since the IDs aren't the same.

The solution here is to store FG's zitem.xml as a data file and load it when playing an FG replay. However, I haven't yet done any of that work at all; instead, I've temporarily stuck to just leaving players naked and giving them a sword, shotguns and meds, which makes at least the gameplay look minimally coherent. Since that's good enough for me personally, I haven't really moved further, but I should do that eventually. ;/

Anyhow, I've added the code to handle V10 in 5e3a5ae, with the caveats that:

So yeah, you can sorta get the gist of the gameplay, but it's pretty dysfunctional.

I guess I'll just leave this issue open to remind me to fix some of these issues.

Let me know if you encounter any other problems with the replays.

varunchopra commented 7 years ago

Is there a reason for RG to support Freestyle replays in the first place? 😃

phugen commented 7 years ago

Nice, I'll test the new update later today. So if I wanted RGunz to display the shared items and replace the custom ones, would it suffice to temporarily and manually replace RGunz's zitem.xml before starting the server and client to make the IDs point to the correct items? It sounds like some work, but I'm willing to invest the time because I want to use the RGunz client for making a movie, and

a) the replay time bar is really useful for that b) FGunz has swapped the "Let's rock" animations etc., presumably just because they can, but they look atrocious so I'd rather use the old ones

Also, you're right. FGunz replays don't show the chat anymore - not sure if that is a bug or a feature.

Edit: Is FGunz's zitem.xml even accessible? It seems like FGunz's system.mrs (or rather, "system.fgz") is encrypted as well, which sounds like a problem for either manually finding finding the IDs or automatically reading them on-the-fly when playing an FGunz replay..

Asunaya commented 7 years ago

Is there a reason for RG to support Freestyle replays in the first place? :smiley:

Well, I want to watch some of them every once in a while, and FG is generally so dysfunctional that it's questionable whether FG itself supports FG replays, so this seems like the best way.

So if I wanted RGunz to display the shared items and replace the custom ones, would it suffice to temporarily and manually replace RGunz's zitem.xml before starting the server and client to make the IDs point to the correct items?

Yeah, that seems to work.

Here is a client I've compiled that contains the latest assets, except with:

It appears to recognize about... maybe half of the items in the replay you linked.

It should be able to load the rest of the models if you add the files as well. Maybe they can be found somewhere on Ragezone, I dunno.

Oh, by the way, you don't need to start the server just to run replays. If you have the replay in the file at, for example, "C:\Replays\Replay.gzr", then you can view it by starting the game with "Gunz.exe C:\Replays\Replay.gzr" and it will start playing it immediately. The Windows shell will also start it like that if you drag the replay file over the Gunz executable icon.

phugen commented 7 years ago

Oh, splendid! I actually found a FG zitem.xml (along with models, actually) from the end of 2016 - I guess I'll just fiddle with it for a bit and see where it goes. Thanks a lot so far!

Also good hint regarding drag-and-dropping the replays, although I have about 1000 of them, and I guess once the replay is done playing, the game will simply close (..right?), so I think I'll stick with starting up the server since it's really no trouble.

Asunaya commented 7 years ago

once the replay is done playing, the game will simply close

Yeah. Forgot about that, good point.

so I think I'll stick with starting up the server since it's really no trouble.

Now that I think about it, you should also be able to look at the replay selection window thingy from just the login screen. I added the button there too. (Inspired by the same feature on FG. ^^)

But yeah, starting the server isn't hard anyway, so it doesn't really matter, I guess.

phugen commented 7 years ago

Ah yeah, running them from the login screen works fine!

I got almost all clothes to load, although it seems like the zitems.xml and models have been changed in the meantime, meaning that I got some funky outfits in my replays, but that's not RGunz' fault in the least :^) So unless I somehow crack FGunz' protection (something I have about zero experience with), I think this is as far as I'll get. I've got another thing to report, but I'll start a new issue for that because it doesn't concern the replays (I think)