-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Steam achievements #1229
base: wip
Are you sure you want to change the base?
Conversation
I don't think I'll get through all the code, though I probably looked over all of it at some point. It does look noticeable cleaner now though! I just realised (although it was always there) that Game now prints to the terminal every single time it's launched:
which is pretty annoying for non-Windows users like me who use the terminal, and we should try to find some way to fix this. Unfortunately I don't know if that's possible if steamworks must be initialized before the window is created -- but does it actually need to be? I think SteamAPI_RestartAppIfNecessary would avoid requiring it. Going to do some tests... I think you should use I think maybe we technically should remove the comments in steam_internal.bi since they're probably copyrightable but I don't think the original C header was meant to be redistributed. But I know that public C# wrapper you linked just translation all the original headers and I don't think Valve care. We have inconsistent indentation but I reserve the right to complain about indentation in new code regardless! Nowhere else do we indent code inside a namespace, and since it encompasses all of Should More tomorrow (maybe). |
Whoops, I don't know what keycombo I pressed to submit a half-written comment. I edited it. |
Wait, I'm not thinking straight. I forgot that aside from steamclient.so there's a second library, libsteam_api.so, which I had placed in the directory next to ohrrpgce-game, which is printing that. So users won't get those messages usually. We may wish to add a Distribute Game option for Steam which adds the steam_api lib, and possibly the appid somehow too. |
I do believe we need to initialize Steamworks before we create the window, so it can hook into opengl/etc properly. Especially if we add the I wonder if we could supress the console messages somehow? Maybe by closing stdout? I agree that we should add the libraries to the distribute game feeature. I've been thinking about how to do this properly (again, especialy for the
Agree on 1 space being bad. 4 spaces is pretty standard in all the code bases and languages that I usually work with, but I'm happy to switch it here (other than the labour of fixing it, but that's what scripting tools are for) I would like to push back a little on this. Even in C++, it is common to indent within namespaces... right? *googles* oh my god it isn't. hm. Well, either way, this is not C++ and not indenting namespaces reads wrong to me. It's not as though we are trying to save characters here. Also, there do exist things outside of namespaces in these files, which imo makes it more important. If you insist, I will unindent, but let it be known that I don't like it!
It should be called for all achievements; Steam will not display it multiple times. It should, however, check for the existence of a steam id before doing so! |
I think what you're really asking here is "how much of Given that we do not use any of those constants at all for any reason, I'm happy to just remove that section. At that point, I think the rest is safe to do with as we need. Unrelated to that, I did a bit more digging and I found this page which somehow we all missed at the start of this project: https://partner.steamgames.com/doc/sdk/uploading/distributing_opensource
(emphasis theirs) I don't think there's anything on that page that is going to be a problem here. I think what they are saying is that if you are using the Steamworks headers (as we would be if this was a C or C++ project), those headers cannot be relicensed as GPL. However, since that's not what we're doing, it doesn't have any bearing on us or people using the OHR on Steam. |
I tried initialising Steamworks after creating the window and it works normally, but the program crashes when you quit, inside the OpenGL driver. So I don't think we'll be doing that. So, uh, sorry I wasn't clear, but I wasn't suggesting switching to two-space indents (not a fan personally). Because I believed you had your editor set to 4-space tabs I suggested switching to tabs as a minimal change which improves consistency. But really, you can use 4 spaces if you want, since each module uses its own code style (which is baffling). Likewise, indent inside the namespace if you have a strong preference. I'm happy to have steam notifications for non-permanent achievements. But if the player previously received it in another game steam presumably won't display anything? If you select non-permanent achievements I think you expect the engine to always show a notification. Does that mean we should also show a slice-based notification in addition to the steam one? Or should we just remove the achievement and then immediately re-award it to force a notification? |
8d95f10
to
60567b4
Compare
This is a complicated subject, but this involves: - adding support for Steamworks - adding support for achievements to be defined - adding support at runtime to detect when achievement conditions have been met There is also a test game that adds support for achievements in Steam's test game
60567b4
to
db6a75f
Compare
This is a complicated subject, but this involves:
conditions have been met
There is also a test game that adds support for
achievements in Steam's test game
Details on the implementation, rationale etc can be found on the wiki page:
https://rpg.hamsterrepublic.com/ohrrpgce/User:Pkmnfrk/Achievements
(Note: I am aware that we can't just merge this PR directly, but I would like to open this up for feedback before pushing it to SVN)