How Do You Handle Supporting Both Steam and Epic Achievements?
I'm ready to create a build of a game I have on Steam for the Epic store.
Right now, I use Unity with Facepunch and authorize with Steam on startup, and achievements work great.
When building for Epic, I'll need to do the equivalent for that platform. I'd prefer to build my app in a way that is smart enough to connect to Steam for achievements if being launched as a Steam app, or connect to Epic if being launched as an Epic app.
The alternative would be to create different builds for each platform, which seems a little crazy.
How have you handled supporting both stores in your code? Are there any tools or techniques I should be aware of?
About this post
- Posted
- Archived
- Score
- 1 · 25% up
- Kind
- Text
- ID
- 18dw7mt
3 comments
You write an API which interfaces to either depending on which sky is built for. Your game code uses that one API and different care or even know what is running on.
If you are using C# for example in Unity or Godot you would simply use conditional compiling via preprocessor directives. Basically, you turn parts of your code "on/off" based on which platform you are targeting.
So in the example below the rest of your code simply call
SomeClass.Instance.UnlockAchievement(etc)with the correct enum value to unlock the achievements. It does not care whether you on Steam, EGS, Itchio, or whatever.I once wrote a system to coordinate achievements for one game across iOS, Android and our own system.
It was so good at it, that QA had a hard time testing it because the moment an achievement was on one, it was already on the others. :D