Raptor007 / aq2-tng

Action Quake 2: The Next Generation. Raptor007's sandbox for testing changes. When verified stable, this code is pushed to the official aq2-tng repo:
https://github.com/aq2-tng/aq2-tng/tree/bots
4 stars 2 forks source link

Use Steamshim to enable Stat Tracking/Leaderboards/Achievements #120

Closed darkshade9 closed 2 years ago

darkshade9 commented 2 years ago

With the impending Steam release, I found this as an interesting way for us to maintain our adherence to the GPL while taking advantage of some of the Steam SDK. Looking to see what your thoughts are @Raptor007 ? As far as linking it and adding it to the Steam release, that's probably the easy part.

https://github.com/icculus/steamshim

Raptor007 commented 2 years ago

The shim sounds like a good way to do this. I knew Steam had achievements of course, but wasn't aware it had other stat tracking. How impending is the Steam release?

Any changes for this feature should be enclosed within ifdef to avoid polluting non-Steam builds. (I wish the same had been done for IRC, but that was before my time.)

Build: make STEAM=y

Makefile:

ifdef STEAM
CFLAGS += -DSTEAM
# FIXME: Whatever includes and libraries are needed.
endif

Code:

#ifdef STEAM
// FIXME: Whatever code changes are needed.
#endif
darkshade9 commented 2 years ago

The Steam release is imminent, we've been fully approved. It's only a matter of a few button clicks and a few weeks of staging before we could be live. We're putting some polish on the client right now, like getting the menu exactly how we want it, default config settings, last minute bug fixes, all that.

On the side, we're also preparing dedicated servers and their configs just in case it gets popular, since it's a multiplayer-focused game, we'd need servers for these players.

Shimming should be the easy part assuming I can compile the shim for all distributions (bug reported https://github.com/icculus/steamshim/issues/2), it's getting the achievements/stats/leaderboards setup that could take a bit of work. I'm not usually one who can write something from scratch in a language I'm barely cognizant of, but if I had working example of one achivement or stat working, I can likely replicate that pretty easily.

Raptor007 commented 2 years ago

For achievements to work with online play, I think SteamShim needs to be added to AQtion's Q2Pro, not the TNG server module.

It should parse console prints for information. For example, to track headshots look for lines that start with You hit and end with in the head\n. https://github.com/Raptor007/aq2-tng/blob/ef8feeb86c060c85090f24404b18dfe3d7ca2e8f/source/g_combat.c#L558

Raptor007 commented 2 years ago

I did some digging into the Q2Pro source and posted more details on the relevant Aqtion issue: https://github.com/actionquake/distrib/issues/47

Closing this issue in TNG, as I'm now fairly certain SteamShim must run with the game client, not the server. Feel free to re-open if I'm wrong about that.