bryanedds / Nu

Repository hosting the open-source Nu Game Engine and related projects.
MIT License
1.15k stars 156 forks source link

OPTPiX SpriteStudio integration feasibility investigation. #616

Open bryanedds opened 1 year ago

bryanedds commented 1 year ago

In addition to integrating Live2D Cubism, let's also investigate the feasibility of integrating this.

reinux commented 1 year ago

SDK

There isn't an English translation as far as I can see, so here's a quick rundown:

The SDK is made up of:

There are also tools, viewers and converters that can be downloaded. Build scripts and instructions exist for Windows and Mac, but not Linux. I don't think we'll ever need this, unless in the distant future we decide we want some deeper integration with Gaia.

SS6Player for CPP

Handles runtime data loading, animation math, platform-agnostic rendering APIs, and comes with an OpenGL reference renderer. Same kind of situation as Live2D, but in C++.

Build scripts likewise only exist for Windows and Mac, but the wiki promises that it's cross-platform compatible, and the library sees use in plenty of mobile and console games, presumably via Unity and Unreal, which have separate runtimes.

There's also a similar library called SS6ssbpLib which seems to only have a "demo" license for whatever is on the repo, and is significantly older. I think we can safely ignore this one, since it appears to be superseded by Player for CPP.

The license

The license is extremely terse and generic, so we might want to see if there's more gotchas somewhere, maybe on the main website.

Next steps

bryanedds commented 1 year ago

Unfortunately, C++/CLI is Windows-only.

C++/CLI, also known as C++/CLI.NET or Managed C++, is a Microsoft-specific technology for bridging native C++ code with the .NET Framework. It's primarily designed for Windows and is tightly integrated with Microsoft's development tools and platform. As a result, C++/CLI is not natively supported on Linux or other non-Windows platforms.

I ran into the same limitation with a 3d physics library i was going to use before Bullet. If the wrapper is simple enough to make a C wrapper and then make a .NET wrapper around that, then maybe it could be a thing. Try to find a C wrapper for SpriteStudio

The problem is that it's hard to make a .NET wrapper around C++. Tho, I think that can be done wihout C++/CLI with enough time and care. But it can be a hard-to-scope task.

bryanedds commented 1 year ago

Ya, if there's no C wrapper, then p/invoke would seemingly be the only way to go.

reinux commented 1 year ago

Nuts, okay. The only other thing I've been able to find so far is a C# wrapper for another C# game engine called Stride3D.

From what I understand, with p/invoke, the biggest hurdle is in deciphering the mangled function names. I assume there's some tooling to help with that, so I'll investigate that sometime in the future.