9 ms·
Yuzu: Nintendo Switch Emulator
- MegaDeKay 5y agoIf you are interested in Yuzu, you're probably also interested in Ryujinx. In a departure from most advanced emulators (Yuzu, RPCS3, etc), Ryujinx is written in C#. https://github.com/Ryujinx/Ryujinx https://github.com/Ryujinx/Ryujinx https://blog.ryujinx.org https://blog.ryujinx.org
- Shadonototra 5y agowhat a horrible language choice for an emulator, no wonder it under performs compared to Yuzu, ton of micro stutters, i bet it's due to the GC and the JIT compiler; on top of using more memory just for clarity, cpu/audio emulation needs predictive performance, you can't have that with C# due to the managed nature of it
- remram 5y agoUnity is the most popular engine for video games right now, and uses C#.
- SXX 5y agoPlease dont confuse gameplay code with the game engine itself. Unity runtime was always written in C++ even though for games and editor they use C#.
- invokestatic 5y agoUses C# for its scripting API, but crucially the engine itself is written in C++.
- dagmx 5y agoUnity uses C# for a certain layer but the engine itself isn't C#. They also do some work for ammortized multi frame GC. That said, there's tons of games written in less than optimal languages for major portions of the game, like Naughty Dog games in the PS1/PS2 era used a lisp based language for a lot of things
- Mikeb85 5y agoIt doesn't. It's a C++ engine with C# scripting (and if you remember, used to also have UnityScript aka. JS scripting).
- Agentlien 5y agoApart from what others have pointed out about Unity's engine code being C++ it also comes with support for IL2CPP which compiles the code to cpp which can be optimised. We've used this on all Unity projects I've been part of and it really makes a difference in performance.
- makotech222 5y ago
- Salgat 5y agoC# does support both low latency GC modes and allows for you to specify regions of execution where GC won't occur.
- cassonmars 5y agoC# isn’t what it used to be — it’s astoundingly good even for high performance code.
- tinco 5y agoI don't know, the name implies they target the RyuJIT, which is a state of the art JIT compiler. I feel in general games should perform really well on a JIT since they are predominantly performance sensitive in a tight loop. Dolphin also has a JIT if I'm not mistaken. The alternative is to interpret which in theory should have worse performance (though in practice there's definitely exceptions to that rule). I think it should be possible to achieve predictable performance, though it depends on the qualities of the JIT, it won't work if it's constantly recompiling or allocating stuff that needs to be garbage collected of course.
- nyanpasu64 5y agoRyujinx used to be built on RyuJIT but they switched away: https://blog.ryujinx.org/summer-progress-report/#armeilleure https://blog.ryujinx.org/summer-progress-report/#armeilleure
- tinco 5y agoInteresting! Thanks for linking that.
- emodendroket 5y agoHaven't benchmarked it but I find it runs better than Yuzu for most games I tried.
- bdowling 5y agoIt's pretty common for game engines to disable background GC and explicitly call the GC only at certain times (e.g., between processing the current frame and before starting the next frame). Sometimes that can be done using the default GC and sometimes it requires a custom incremental GC. Same idea applies to a JIT. Getting the best performance may require tuning the JIT to only run at certain times (e.g., before starting a level).
- markjgx 5y agoGlad this was flagged. A lot of people have a misconception of managed languages being slow compared to your regular ol' binary program, these days that couldn't be further from the truth. In traditional high performance C/C++ development you have to manually split your code into hot and cold paths, static analysis optimization can only go so far. Do you want to inline this function in your loop? Yes and no, i.e. you might be taking up some valuable registers in your loop, increasing register pressure. Time to pull out the profiler and experiment, wasting your precious time. Managed languages have the advantage of knowing the landscape of your program exactly, as __that__ additional level of managed overhead can help the VM automatically split your code into hot and cold paths, having access to the runtime heuristics of your program allows it to re-JIT your hot paths, inline certain functions on the fly, etc.
- umvi 5y agoCan anyone comment on how you can emulate a modern console like Gamecube/Wii/Switch and run games at full speed? Last I checked, the (CPU cycle accurate?) SNES emulator Higan/BSNES still experiences framedrops/slowdown on modern hardware, and that's for a 30-year-old console. What's the shortcut/secret sauce that allows emulating modern consoles on modern PCs at full speed?
- meibo 5y agoModern computing architectures tend to be very similar. They use a process called high level emulation(HLE) where API calls to the emulated kernel, subsystems, graphics driver are basically "translated" to the host system, which allows for the high speeds and relative accuracy that lets games run beautifully. In the end, the only "traditional" emulation you'd be seeing is the CPU for the switch, which is a 64bit ARM CPU, and translated into x86 via a JIT. If you think about wine and dxvk, it's pretty much the same concept, without the need to emulate a CPU. On the contrary, Higan uses low level emulation(LLE), wherein the actual hardware of the system is emulated as faithfully as possible, which is very CPU intensive.
- udbhavs 5y agoAn interesting result of this is some emulators like PPSSPP or Dolphin can run several heavy games near flawlessly at this point yet they still can't emulate the system's UI or home screen because they use low level OS syscalls that games don't need. RPCS3, a PS3 emulator recently managed to boot into the cross media bar after a lot of work (https://www.pcgamesn.com/emulation/ps3-emulator-rpcs3-xmb https://www.pcgamesn.com/emulation/ps3-emulator-rpcs3-xmb)
- indolering 5y agoThe Dolphin can run the Wii menu fine now [1]. Indeed, every game in the Dolphin compatibility database is rated as playable with only minor glitches ... except one: an N64 title that uses a custom emulator. The title itself works fine when the binary is extracted and run on an N64, it's some low level weirdness that does not. But yeah, the progress reports are now mostly fixes for very low level stuff like emulating a specific hardware cache just right or matching the /exact/ semantics of AMR64 floating point for certain titles. [1]:https://wiki.dolphin-emu.org/index.php?title=Wii_Menu#Keyboard_Is_Not_Completely_Displayed https://wiki.dolphin-emu.org/index.php?title=Wii_Menu#Keyboa...
- Levitz 5y agoI've always thought that a project like this, enabling piracy while being financed via Patreon, would eventually meet its doom once some bee's nest is struck. I'd like to hear thoughts on the matter.
- skymt 5y agoBleem successfully defended their commercial PlayStation emulator against a lawsuit from Sony, setting a solid precedent in US law even though the legal costs ended the company. https://en.wikipedia.org/wiki/Bleem!#Sony_lawsuit https://en.wikipedia.org/wiki/Bleem!#Sony_lawsuit
- farmerbb 5y agoEmulators absolutely do not enable piracy. One could argue that their existence implicitly encourages it, but they certainly don't "enable" it by any means. There are many different ways to legally obtain games to run on emulators, Switch included.
- lvass 5y agoEmulators do enable piracy. But so do computers, and it's not a valid argument against them by any means. It's perfectly legal and moral/ethical to use an emulator to play games in many circumstances.
- sjroot 5y agoThese sort of arguments are really tiresome. I’m absolutely a fan of engineering feats like these being made more accessible for educational purposes. Even in college, I built a NES emulator on an FPGA. But to argue that it’s primary motive is not to facilitate (and potentially profit from) piracy is not grounded in reality.
- lvass 5y agoI see no one arguing this here at all. Much on the contrary, I'd say piracy is a console emulators most common use. But it's still fine. All that matters is there's a possibility they're being used for good things. If someone does something bad he's responsible for it, not the creator of the tools he used. Even if you don't like what most people use something for, just the possibility of one person doing it right is much more than enough reason for it to built. We call this individual freedom, and it's much more important than (game publisher's financial) security.
- jonpalmisc 5y agoI would love to see a Switch emulator for the M1, although I certainly understand why it'd be a last-priority for emulator developers. I know /nothing/ about emulator development, but I wonder what the performance of a Switch emulator written for the M1 using Metal for graphics would look like. I'd expect the Switch and the M1 both being ARM would be an advantage? Would be curious to learn more if anyone in this space wants to weigh in.
- deleted 5y ago[deleted]
- Gigachad 5y agoI only know a small amount but from what I have seen, having the same CPU arch is not really that important, as we have seen, you can run x86 apps on the M1 at blazing speeds. The hardware in modern consoles is becoming pretty standard, so the vast majority of effort goes in to emulating the libraries and such the switch comes with. Modern emulators are a lot like Wine these days where they are just translating the custom api calls to something that works on a desktop OS.
- schappim 5y ago>> CPU arch is not really that important It actually depends more on the memory ordering. To speed up the running of x86 apps, the M1 has a strong memory-ordering mode designed to match x86.
- aufhebung 5y agoThere is an experimental PS4 emulator that ran using QEMU, taking advantage of the fact that the PS4 is x86. Something similar could be done for M1 and ARM. https://wololo.net/2021/09/08/release-spine-ps4-emulator-v-20210901-ps4-emulator-for-linux/ https://wololo.net/2021/09/08/release-spine-ps4-emulator-v-2...
- kaladin-jasnah 5y agoHow does one GPU acceleration when running on a VM (as I imagine QEMU is doing here)? Also random thought, but can the opposite be achieved? That is, installing Orbis (PS4 OS, based on FreeBSD) on generic PC hardware?
- emodendroket 5y agoIn my experience Ryujinx works a little better.
- dang 5y agoPast related threads: Yuzu (Nintendo Switch Emulator) Progress Report January 2021 - https://news.ycombinator.com/item?id=26095834 https://news.ycombinator.com/item?id=26095834 - Feb 2021 (89 comments) Nintendo Switch Emulator - https://news.ycombinator.com/item?id=25522454 https://news.ycombinator.com/item?id=25522454 - Dec 2020 (12 comments) Yuzu-Emu/Yuzu: Nintendo Switch Emulator - https://news.ycombinator.com/item?id=20200098 https://news.ycombinator.com/item?id=20200098 - June 2019 (1 comment) Yuzu – Nintendo Switch Emulator - https://news.ycombinator.com/item?id=16150777 https://news.ycombinator.com/item?id=16150777 - Jan 2018 (171 comments)