Erfaniom

Erfaniom

5
25 May 19
25 May 19
465h 39m
100%
Erfaniom

NEW_ACHIEVEMENT_NAME_0_4 achievement in Spacewar

NEW_ACHIEVEMENT_NAME_0_4

NEW_ACHIEVEMENT_NAME_0_40
25 May 2019 - 3 guides
Hide ads

How to unlock the NEW_ACHIEVEMENT_NAME_0_4 achievement

  • SirGuySWSirGuySW118,065
    16 Mar 2021 16 Mar 2021 29 Mar 2021
    2 0 1
    Preamble:
    This is merely a rough sequence of steps required to obtain the achievement. Some coding experience is beneficial, possibly even intended to be required by the initial developers. I wrote this guide because I wanted to demonstrate that the achievement is available within the intended scope of the project since it was incorrectly marked as unobtainable ('unobtainable' flag removed as of March 28, 2021).

    A note about manipulating game files from the 'Solutions Rules and Guidelines':
    Please be aware that editing or manipulating game files is considered cheating on-site. Achievement solutions should not include any methods of unlocking achievements that involve editing or moving game files unless the developer explicitly states to do so.
    The purpose of Spacewar is for developers to learn about the Steamworks SDK by studying the game code and documentation. Additionally, the documentation contains detailed steps to assist developers to build the game ourselves from code and heavily implies that developers are expected to manipulate the game code to learn the SDK. While this is not an explicit statement, given the nature of the project as a developmental resource, the availability of the source code, the listing of detailed steps required to build the project ourselves, and what appears to be the intentional omission of the final achievement from the source code it seems silly to limit Spacewar by the above rule as if it were a normal closed-source game.

    Achieving this achievement has been confirmed to cause invalidation on other achievement communities.


    Introduction:
    This achievement is not broken or unobtainable. It's just not coded into the game. Spacewar is the Steamworks example project. All game code (and extensive documentation) is freely available to everyone. Developers are expected to experiment with this game's code to learn about the Steamworks SDK. I like to think that the initial developers left this achievement out of the game code as a way to encourage future developers to learn the SDK by adding it in ourselves.

    Source:
    Covers setup, general Steamworks SDK info, and invitation to build the game ourselves: https://partner.steamgames.com/doc/sdk/api/example

    Setup:
    1. You'll need the DirectX SDK from June 2010 (http://go.microsoft.com/fwlink/p/?linkid=226640). If you have a 2010 C++ redist already installed the installer might fail. if it does: uninstall any 2010 C++ redist, rerun the DirectX SDK installer, then optionally reinstall the 2010 C++ redists if you want.
    2. You'll need the Steamworks SDK extracted somewhere (the Spacewar game code is in a subfolder at '\sdk\steamworksexample\'): https://partner.steamgames.com/downloads/steamworks_sdk.zip
    3. You'll need a C++ compiler. Any of the modern Visual Studio's should be fine (some of the more modern versions might require the project to be updated and might show minor compile errors from deprecated or removed functions).
    4. If using Visual Studio open the project via File -> Open -> Project/Solution -> Open the file at '\sdk\steamworksexample\SteamworksExample.sln'.
    5. Make sure to setup the proper include and libraries directories. If using Visual Studio that can be accomplished by navigating to the project properties dialog: Project -> Properties -> Configuration Properties -> VC++ Directories -> [Include Directories, Library Directories] = "$(DXSDK_DIR)Include;$(IncludePath)" and "$(DXSDK_DIR)Lib\x86;$(LibraryPath)" respectively (screenshot).
    6. Try to build the project. If you encounter errors do a web search on the Error Code and fix it. Don't try to move on until you can successfully build the project. For example, I used Visual Studio 2012 and encountered an error where the function 'snprintf' was not found (https://stackoverflow.com/a/9052232 | tldr: rename the function call to '_snprintf', easy).

    Code the achievement:
    1. Open the code files that handle achievements (StatsAndAchievements.h, StatsAndAchievements.cpp). In Visual Studio use the solution explorer to open Header Files/Source Files -> Game -> StatsAndAchievements.h/cpp (screenshot).
    2. In file StatsAndAchievements.h observe the 'EAchievements' enum defined on line 15. There are only four achievements defined, the fifth is missing. Add it (the achievement API name is 'NEW_ACHIEVEMENT_0_4'). Screenshot
    3. In the file StatsAndAchievements.cpp observe the 'g_rgAchievements array defined on line 23. It only defines 4 achievements, add the fifth. Screenshot
    4. In the file StatsAndAchievements.cpp observe the function 'CStatsAndAchievements::EvaluateAchievement' defined around line 207. This function contains the logic that determines if any achievement should be unlocked. It only contains logic for the first four achievements, add logic for the fifth. The logic in the screenshot will simply unlock the achievement when the game starts (highlight shows new code). Screenshot

    Obtain the achievement:
    1. Build the project and run the game (make sure Steam is running). In Visual Studio you should be able to just use the Debug 'Play' button. Otherwise you'll need to find and run the exe (SteamworksExample.exe) in your project folder.
    2. Complete whatever requirement you set for the achievement in step #4 under the 'Code the achievement' section and you should see the achievement pop up like normal in the bottom right corner.


    Best wishes to all.
    Showing only comment.
    monsef987worked ty
    Posted by monsef987 on 04 Dec 22 at 21:13
  • Have you got any tips or tricks to unlock this achievement?
    Add a guide to share them with the community.

    Sign in and add a guide
Do you have a question about this achievement? Please post it in the Spacewar Forum