CurryKitten / CurryKitten-Sim

FPV quad simulator
67 stars 7 forks source link

Investigate the use of the Steamworks API to introduce online leaderboards #86

Closed CurryKitten closed 3 years ago

CurryKitten commented 3 years ago

Whilst I was considering the use of writing some serverside code to my own website to act as a leaderboard holder, I wondered if it would make more sense to look at Steams API in order to use their own infrastructure. As I potentially wanted to check at some point to see if I could use their p2p online gaming API to have more than 4 people in an online game, this is probably quite useful to get to grips with the API.

I'm already the Steamwork.Net C# wrapper (http://steamworks.github.io/) to get the sim Steam compliant so the leaderboard facility is in there, but I'll need to have a good tinker with it to understand things. Results of this will dictate whether leaderboard will go into the game on it's release or come later.

CurryKitten commented 3 years ago

I was having issues getting anything to work with the steamworks wrapper, but on reading the documentation on the Steam site they also mention facepunch.com and their wrapper. The Facepunch version is actually a lot easier to work with as they've reworked the code into nicer methods rather than just wrapping each function into minimum c# code.

I was able to integrate pushing a time out to a Steam leaderboard for each of the levels in quad-ball along with an overall time. These are viewable from the Steam site.

Screenshot 2021-03-08 at 22 59 47

Whilst the basics are done on getting these enabled, there's more work to do here later - such as dynamically telling people where they are in the global leaderboard, or comparing to friends etc. But I want to get some more names into the leaderboard to see what this looks like, so I'll come back to it at a later date.