xenia-project / game-compatibility

https://xenia.jp
BSD 3-Clause "New" or "Revised" License
457 stars 145 forks source link

534507D6 - Sonic the Hedgehog #285

Open Ichigo14 opened 8 years ago

Ichigo14 commented 8 years ago

Marketplace

Issues:

Ingame with major glitches.

sonic3 sonic sonic2

Labels:

state-gameplay, gpu-corrupt-drawing

Ichigo14 commented 8 years ago

Tested on EmuCR-Xenia-20151215.

title screen it's ok now

xenia333333

cmexp commented 8 years ago

It seems a new bug has popped up on certain hardware configurations for this game in later builds.

I noticed that certain actions would kill me instantly while showing me a black screen (or a frozen screen) until respawn. And watching videos of people playing the game on the same builds I was testing this on, it seems the bug is not affecting them. The system I was testing this on had a GTX 980, Intel 5930k, DDR4 2133 RAM, and Windows 10.

The things that trigger this are:

And as you can see there are also issues with the game camera (which is bad on real hardware but not that bad)

theoldsport commented 8 years ago

@cmexp I'm getting the same behavior on the latest build, plus physics are all over the place. How did you get around the half-screen + swapped color palette? ex- ex

theoldsport commented 8 years ago

@cmexp Oh... well that's cheating! I guess my screenshot is a more accurate representation of how the game currently runs (unmodded)

cmexp commented 8 years ago

To be fair, it's only the graphics that are fixed. The physics are still all over the place in the modded game.

Parovozik commented 7 years ago

@SilverSzymonPL This half-playable (Sound OK, but some broken graphics and game mechanics) LvL Crysis City (Vulkan) https://www.youtube.com/watch?v=CjHccEYhz5g LvL Ocean Wave (OpenGL) https://www.youtube.com/watch?v=h_Jr5GbuSI8

HorrorTroll commented 7 years ago

image image image image image image image image image

It work everything right texture all of NPC, the camera have a little buggy on wave ocean like before. The rings, sonic spikes on head it has been many error!!

Updated: Main meny background have black on half, no gun effect when robotnik shoot. Chaos Emerald is just a shape, not like the old build. Tree, flower is buggy, water is not animation. Background is just a black!!! Tails is normal now not buggy anymore!!

Use light chip on wave ocean, jump on 3 springs, jump to the whale head it will be a black screen and lose a life!!

This is the test on OpenGL in build (https://github.com/benvanik/xenia/commit/5b8b339c388a0ff4c8be113d46bc30b5dc3bd5e4)

On Vulkan test is just a black screen only hear the sound, button working!!!

Irixion commented 7 years ago

AMD GPU here. The retail release doesn't crash while using Vulkan, but has depth issues when using the cache.arc hack linked above.

untitled

Using the game vanilla just gives me a black screen. HUD elements work however.

jthecodebuilder commented 7 years ago

I have a Nvidia GPU, not AMD.

Irixion commented 7 years ago

Try updating your build, it shouldn't crash now. For me, it was just a temporary regression for one or two builds. Really hoping that AMD users will see some more parity with their nVidia counterparts. GL runs like molasses compared to the Vulkan...though without game modification the game doesn't draw any 3D assets.

Irixion commented 7 years ago

https://gist.githubusercontent.com/Irixion/30a55942162bccdb5046357d3e4e70cb/raw/e29c7bbab465fad78d65e0bf5bfb8289a53be698/xenia.log

Here's the log. Specifically this bit:

w> 00000004 GPU: Write to unknown register (045E = 00000004) w> 00000004 GPU: Write to unknown register (045E = 00000004) w> 00000004 GPU: Write to unknown register (045E = 00000004) w> 00000004 GPU: Write to unknown register (045E = 00000004)

Lots of unknown register warnings.

ActualMandM commented 7 years ago

On latest master, it crashes at beginning loading on Vulkan. Using AMD GPU and CPU

Windows 10 (64 bit) AMD FX(tm)-6300 Six-Core Processor AMD Radeon (TM) R7 360 Series

Log file: xenia.txt

Parovozik commented 7 years ago

Tested on (https://github.com/benvanik/xenia/commit/cecc66622f278ca057e19afe86768af6dfe640ba)

Issues:

Vulkan. Color bug, invisible hair on Sonic OpenGL. Invisible hair on Sonic Core. Black screen bug if uses triple jump-pad (not freeze, not crash, game restarting from last checkpoit), black screen bug on dolphin (there auto change character but go on restart from last checkpoint). Sometimes blackscreen bug on circle-jump. Sometimes no physics (collision?) and Sonic falls through (example qte on jumping), but if locked 30fps then this works more good (but slow-mo ingame speed) Audio - OK. Performance is good.

Logs:

Sonic_Vulkan_60FPS.txt Sonic_Vulkan_30FPS.txt Sonic_OpenGL.txt

Video:

YouTube_Sonic_Vulkan

Screenshots:

Vulkan: desktop 04 23 2017 - 01 48 39 02 mp4_snapshot_01 26_ 2017 04 23_02 22 13 Vulkan: desktop 04 23 2017 - 01 48 39 02 mp4_snapshot_00 42_ 2017 04 23_02 23 36 OpenGL: desktop 04 23 2017 - 02 00 41 04 mp4_snapshot_01 18_ 2017 04 23_02 24 09

Labels:

gpu-corrupt-drawing gpu-missing-drawing cpu-timing (?) state-gameplay

Irixion commented 7 years ago

@slashiee Your issue is caused by AMD's drivers. Upgrading to the latest drivers causes it to crash on my system as well. Removing them and letting Windows install them allows it to function properly.

@Parovozik The black screen "bug" is a crash handler in the game. It just kills you when it doesn't know what to do and reloads from the last checkpoint. As far as collision, the game's logic runs at 60 fps. If capped to 30, some unusual things may happen.

Irixion commented 7 years ago

https://www.youtube.com/watch?v=eTrbLqsxncc - Vulkan

https://www.youtube.com/watch?v=fOsP-yF-mXI - OpenGL

On the latest build, using the modified cache.arc file.

Parovozik commented 7 years ago

Tested on (https://github.com/benvanik/xenia/commit/84758a3a3faa03aed86611380ead1660f2e4657b) Now colors more correct, but still bugs as triple-jump-pad and etc

Video:

YouTube_Sonic2006_Vulkan

Screenshot:

xenia sonic2006 vk60 mp4_snapshot_00 53_ 2017 05 14_03 03 57

Irixion commented 7 years ago

Can the labels be modified to include: gpu-missing-drawing cpu-timing

Currently I get a black screen with just HUD elements on Vulkan, but I'll try the newest build once I get home. AMD 😥

Irixion commented 7 years ago

https://www.youtube.com/watch?v=R344TIDtbss

screenie

Without the cache modification this is all I get.

AllanCat commented 7 years ago

Workaround

I've just fixed the jump pad and camera error by rolling back this part in xenia-cpu:

  1. Commented out OPCODE_SPLAT in constant_propagation_pass.cc This is the main reason that cause various games's camera and vertices go wrong (PR#514)

You can find the exactly changes on my forked branch (Sorry about the space indentation lol)

Video

https://www.youtube.com/watch?v=AaJQHpAxCxQ Everything seems back to normal, the game is pretty much playable now 💯

btw I don't know if this fixes/breaks the other games, also I have literally zero acknowledge of 360 emulation so I'd called this a workaround. That'd be cool if some developers can look into these codes. Should I raise a PR or Issue?

Edited: Deleted my change to ppc_emit_fpu since I can't reproduce nan's error, maybe it's just me missing something.

ActualMandM commented 7 years ago

I still have no clue on how to get this game working on Vulkan. Even on my new computer, it crashes on boot. OpenGL works fine, though.

GeForce GTX 1060 6GB Intel Core i5-7600K @ 3.80GHz 16GB RAM DD4-2133MHz

image

Irixion commented 7 years ago

I have the same card. Though, make sure your drivers are up to date and that Vulkan is installed. Also, sometimes Xenia crashes for no reason when the log file exists. Try deleting that. Also try extracting the ISO's contents, and using the cache.arc replacement that's linked in this thread.

ActualMandM commented 7 years ago

@AllanCat Cache file works, thanks!

image

Irixion commented 7 years ago

There's only a couple of things that are still off with the game, though it's very close to perfect emulation. Hoping the Vulkan thread gets unlocked so we can discuss things. You're my hero @AllanCat

gibbed commented 7 years ago

@Irixion While it's nice a temporary workaround was found, reverting changes blindly is not going to be accepted as a PR. This however, can be taken note of and be investigated when a contributor has time to.

AllanCat commented 7 years ago

Got some time messing around with cache file. You can get it from here

  1. Fixed map graphic issue as the original cache hack didn't render it properly. (core/render_radermap.lub)
  2. OpenGL Speed up(by set GenerateCSMLevels and GenerateCSMObjects to 1), I'd say about ~20% faster though it still slows down at various situations(Too Much Water). At least it runs almost 60fps in crysis city and wave ocean.

Also by reducing audio buffer (kMaximumQueuedFrames in audio_sysrem.h) the latency feels better.

Video: https://www.youtube.com/watch?v=pOpKpM-N7xY At this point I think I've already gone too far and done what I can with this game. Cheer up :D

Irixion commented 7 years ago

@owner Feels like there's regression with that in there though. The audio buffer (kMaximumQueuedFrames in audio_sysrem.h) though needs to be adjusted for Vulkan--the audio is slightly out of sync with the video.

@AllanCat Some levels set CSM levels for terrain and objects on their own. Xenia doesn't seem to be generating any shadow maps though, so levels look flat on both backends. However, how did you manage to edit the lub file? Did you use chunkspy?

There's some miscolouration on effects, things like flames for example. There's also some effects (such as bloom) that are misaligned (to the right) of where they should be. Not sure if the gpu corrupt tag is the right one for that.

AllanCat commented 7 years ago

@Irixion There's exactly one unluac fork that supports for lua5.0, it still has problem about for loop. Here I'm just bypassing the error: decompile\Registers.java

  public Target getTarget(int register, int line) {
    if(!isLocal(register, line)) {
      //throw new IllegalStateException("No declaration exists in register " + register + " at line " + line);
      //
      decls[register][line] = new Declaration("_TMP_", 0, 0);
    }
    return new VariableTarget(decls[register][line]);
  }

This is a bit off topic, I think we can discuss on other place(discord or so). Thanks!

AllanCat commented 7 years ago

Did some more researches about what works and what not, here's my progress so far:

Video:

https://www.youtube.com/watch?v=6GcLpbTM2QA

Reports:

Xenia issues:

Found three spots which broke a lot of games, still need to fix them instead of just reverting the commits. (mentioned here and here)

Common issues:

  1. Not supporting MSAA caused game crash(vulkan) or glitched(gl). Fixed by removing all MSAA parameters in cache file. Note that's probably the reason makes other games not working too.

  2. Building&Character's shadow isn't cut correctly so that the whole ground became dark gray. Fixed by removing all shadow effects, this speed up openGL a lot.

Vulkan issues:

  1. Color is darker than console/gl. It's been noted maybe something wrong with channel swapping, hoping that can be fixed soon.

  2. Some reflecting effect has wrong color map(like sea in town, Sonic's shoes and Amy's ring gloves) This is probably caused by Vulkan not supporting k_2_10_10_10_FLOAT color format(GL can mapped this to GL_RGB10_A2), maybe we need to convert k_2_10_10_10_FLOAT to other formats.

OpenGL issues:

  1. Missing textures for all people in game, even Alise and Eggman. I really don't know why. orz.

Screenshots:

Some screenshots about the issues mentioned above: https://imgur.com/a/K35Xb

jackchentwkh commented 7 years ago

will it be better to put those common issues to the issue list instead of burring here? even the vulkan issues are common issues since vulkan is now the only one being supported instead of GL.

Irixion commented 6 years ago

@jackchentwkh That would be great, but the Vulkan thread is locked. I think the only reason he's comparing the two is because GL supports some things that Vulkan doesn't, and it would be helpful to look and see how GL does it, to implement similar functionality to Vulkan.

@AllanCat I've sent you a message on YouTube. Did you get it?

As far as the textures for the townspeople, I think that it's got something to do with the CPU instructions that were reverted as it worked for me in earlier builds.

AllanCat commented 6 years ago

@Irixion Sorry I just noticed your youtube msg now ;p I'm assume your earlier build was used old cache patch like here, the color you saw was not actually a texture. This cache applied a built-in shader called "simple" which simply draws solid color when rendering objects. I was messing around to try if I can apply it only on people and I failed. :c It affects too many objects and is not useful at all.

DoctorGibuz commented 6 years ago

Crashes when choosing an episode for me using a hacked cache and OpenGL. screenshot_26

jackchentwkh commented 6 years ago

May I ask what is the tool you guys used to trace/debug the shader?

Irixion commented 6 years ago

We looked at the game's rendering pipeline to see exactly what it was doing, and compared that to what Xenia does. That being said @DoctorGibuz --what's your crash log say? The last line? Don't use GL. It's deprecated and should only really be used if you're on AMD. What's your hardware?

DoctorGibuz commented 6 years ago

Specs: OS: Windows 10 64 bit GPU: Radeon R7 Graphics CPU: Radeon R7 A750k 3.3ghz Quad Core Ram: 16GB

I tried using Vulkan but everytime i do it crashes, i assume this is because of the fact i haven't got a Vulkan GPU yet.

Anyway here's the log

CrashLog.zip

Irixion commented 6 years ago

@DoctorGibuz

AMD cards don't support a format required by Xenia to run.

lumo93 commented 6 years ago

Specs: GPU: GeForce GTX 1050 Ti 4GB CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz Skylake Memory: 16 GB RAM Operating system: Microsoft Windows 10 Pro Vulkan Runtime Version 1.0.42.1

Video of the Build I downloaded: here

The build itself: here

So Vulkan crashes immediately for me, although it almost loaded once, it doesn't leave a log file, I'll keep on trying though.

As for OpenGL, well I get this

Basically discoloration and that half screen glitch, up until the mach speed zone where everything looks and works alright save for the frame dip halfway through it. Then after the goal ring, it reverts. It's the same for the others, although I haven't done Radical Train yet, I assume it's the same. I thought it was weird, and heard no mention of it so thought I would just put it here. OpenGL does leave a log file, so I'll include that. xenia Sonic 06.txt

I know OpenGL support is discontinued, just thought I'd include it, honestly if Vulkan would work for me I'd just use that.

I'll probably keep playing around with it, might be better if I built from source myself probably :/

If this is all useless feel free to delete my comment 👍


@Parovozik so I saw the loading arrow and it stopped halfway and crashed again, I think it might be a process on my PC acting up, I ran it under vulkan first then tried OGL and it seemed identical to before. I'll see if I can find what's causing the issue for me, I feel like it might be external.


@Parovozik I had a cache file, I tried yours, and I also tried without, it seems inconsequential, Vulkan still won't run, and OGL behaves exactly the same way. I did run the game extracted using the xex file. We can rule out cache issues, and build issues. If you have any other ideas I can keep trying. I think we should work on why vulkan won't start for me. I know it starts and immediately crashes, but that's it. I'll keep on trying other stuff. Thanks for helping me with this 👍

Edit: I actually want to know how the game works for you.

Parovozik commented 6 years ago

@lumo93 You can look my video record here (https://www.youtube.com/watch?v=bOF_XxOhXXY)

Irixion commented 6 years ago

The only reason the original cache crashes is MSAA is not supported on Vulkan just yet. @Parovozik. As for your crashing @lumo93 , attach the vulkan crash log file.

lumo93 commented 6 years ago

@Irixion I'm attaching the log file, took a while to find for me

Xenia Sonic 06 Vulkan.txt

@Parovozik You got the same card as me, nice, at least I can rule out that

lumo93 commented 6 years ago

@Irixion and @Parovozik So I realized I was putting the cache ark in the wrong spot, when I corrected it, Vulkan decided to start loading, I'm using the same build as the one in the log I just sent, although I accidentally minimized and it crashed again.

I had to remake the log file, this one doesn't have the minimize crash but I can try to recreate it if you want. Xenia Sonic 06 Vulkan Running.txt

Sonics quills are missing in this build still but I'm just glad it works now 👍

Irixion commented 6 years ago

@ItsIggy The cache file only disables MSAA (Which the emulator doesn't yet support), which is why an unmodified game crashes, and comments out the lines that tell the game to calculate and draw the dynamic shadows (which is all of them) for objects and geometry.

AMD cards don't support a needed texture format. Until a workaround is implimented, you're out of luck. Your only bet is to use the deprecated OpenGL backend.

Xenia doesn't have enough contributers to speedily impliment and fix problems, unfortuately. So it's a waiting game.

AlexS2412 commented 6 years ago

this is the save file i am using. also my xenia folder is already in C;/emulators/ . SonicNextSaveData.zip

image

also here is the log from when the game was running xenia.log

is there any other way to fix it? @Irixion

Irixion commented 6 years ago

@AlexS2412 Your save file .bin should be in "XENIA\content\534507D6\00000001\SonicNextSaveData.bin"

AlexS2412 commented 6 years ago

It is. @Irixion

Edit: Found out it's caused by scp server. If it's installed, xenia magically can't save. I don't get why it happens, but it does.

lumo93 commented 6 years ago

@AlexS2412 I think it's the way scp server manipulates xinput, which probably affects saves. I know the controller has to have the player one designation or it won't work.

AlexS2412 commented 6 years ago

I figured out it will work fine as long as you force scp,or whatever output client you are using to make the controller as the 1st controller. It works fine with my ds3 controllers and my switch joycons

jpb18 commented 6 years ago

Hey there!

Currently I've a problem right after the first cutscene of this game. Once the cutscene ends, Xenia will loose the graphics device and stop rendering the second cutscene:

image

Current hardware: Intel Core i7-7700HQ NVIDIA GeForce GTX 1050 4GB Version of Feb 14 2018, using the Vulkan renderer.

Also attached is the log file: xenia.log

However, let me congratulate you guys! Last time I checked, I couldn't even get past the first loading screen =P

lumo93 commented 6 years ago

@jpb18 I'm not sure how much help this will be for your case, I know that my GTX 1050 TI has more recent updates that for whatever reason remove vulkan. I doubt that's your issue, but just in case, check out the Vulkan Hardware Database and look for your card and operating system, If vulkan was removed I'm not sure how you would even be playing it tbh, but give it a shot. Just look for the latest update on that list, that's the one that has vulkan, it's a bit older for sure, but it's the only way to use Xenia as far as I am aware. (There's opengl but they are doing away with that). Let me know how that works out for you.

SonicASD commented 6 years ago

For some reason whenever I try to run Xenia without using an external controller the emulator runs at half speed. After connecting my dualshock4 controller the emulator will go back to full speed. Anyone know why?

Quick sidenote, anybody figured out how to go about editing the LUA files in the game? Curious as to how the files inside of cache.arc were edited.