TerryCavanagh / VVVVVV

The source code to VVVVVV! http://thelettervsixtim.es/
Other
6.95k stars 557 forks source link

[Enhancement] GOG Galaxy achievements #54

Open ePirat opened 4 years ago

ePirat commented 4 years ago

Would it be possible to support GOG Galaxy achievements in addition to Steam?

I have no idea if they offer an SDK for this like Steam or something, and apparently its impossible to get any info about this without being a GOG-approved Game developer.

flibitijibibo commented 4 years ago

Yeah, I've only ever seen GOG Galaxy used a couple times, and rarely have I seen the SDK - it's very private, so I don't think I could get away with integrating it here like I did with Steamworks. I'd totally be up for adding GOGNetwork.c if I was allowed to though!

ePirat commented 4 years ago

Well there is https://github.com/gogcom/galaxy-demo-app so it seems as long as you would not publish any of their headers and obviously not the app tokens, it would be possible? Or is this example not using their SDK?

flibitijibibo commented 4 years ago

Oh, I had no idea they published those out in the open! Okay so maybe it’s feasible now. The only caveat is that we have to use their C entry points, since we need to dlopen the SDK like we do with Steamworks. Aside from that, I think the only barrier is GOG’s equivalent of the appid. EDIT: Also, I’ll probably have to rework the network layer so we can support both with a single binary...

ePirat commented 4 years ago

Why is dlopen'ing needed? If the SDK is not present at build-time (CMake does not detect it) you could just not build the relevant files?

flibitijibibo commented 4 years ago

It’ll be the same deal as Steamworks - we’ll do all the typedefing and loading ourselves. This prevents dependencies on proprietary SDKs and makes it so a single binary is all I need to build for Steam, GOG, Humble, Itch, etc.

ePirat commented 4 years ago

Ah, I see! That might indeed be hard if the GOG SDK is C++ only as its not possible to do that then, due to C++ name mangling…

flibitijibibo commented 4 years ago

Thankfully they have C entry points for C# integration (needed by Unity, XNA/FNA, etc.) so we can use those instead.

flibitijibibo commented 4 years ago

I wrote in the multi-backend support:

https://github.com/TerryCavanagh/VVVVVV/blob/master/desktop_version/src/Network.c

Now it's just a game of fill-in-the-blank:

https://github.com/TerryCavanagh/VVVVVV/blob/master/desktop_version/src/GOGNetwork.c