Skip to content
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

GSoC Midterm Evaluation: Steam Workshop SDK/Third Party Integration #2343

Closed
wants to merge 94 commits into from

Conversation

k0T0z
Copy link
Contributor

@k0T0z k0T0z commented Jun 3, 2023

Closes #1881. This PR is part of the Google Summer of Code 2023 program.

I will be updating my Logs inside my domain.

Note: ✔️ means that SOG/unit tests for the corresponding function are provided.


Steps To Run The Code In This PR (Ubuntu Linux 64-bit Only) (Working perfectly):

Note: You may have to edit paths provided in the below steps depending on where you cloned enigma-dev
  1. Download Steam.
  2. Now edit the .bashrc and add these two important exports:
cd ~
vim .bashrc
  • 64-bit
export LD_LIBRARY_PATH=~/Desktop/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions/Steamworks/gameclient/steambinder/Steamv157/sdk/redistributable_bin/linux64:${LD_LIBRARY_PATH}

export LD_PRELOAD=~/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so:${LD_PRELOAD}
  • 32-bit
export LD_LIBRARY_PATH=~/Desktop/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions/Steamworks/gameclient/steambinder/Steamv157/sdk/redistributable_bin/linux32:${LD_LIBRARY_PATH}

export LD_PRELOAD=~/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so:${LD_PRELOAD}
  1. Now run:
cd enigma-dev
./emake -r CommandLine/testing/SimpleTests/steam_general.sog -e "DataStructures,GTest,Json,Steamworks" -o /tmp/test

Steps To Run The Code In This PR (Windows 64-bit Only) (Working perfectly):

Note: Windows support will be postponed due to an ABI issue as ENIGMA doesn't support MSVC yet, I recommend using Ubuntu Linux - 20/06/2023 00:45
Note: You may have to edit paths provided in the below steps depending on where you cloned enigma-dev
  1. Download Steam (I'm using v2.10.91.91).
  2. Copy the steam_api64.dll from enigma-dev\ENIGMAsystem\SHELL\Universal_System\Extensions\Steamworks\gameclient\steambinder\Steamv157\sdk\redistributable_bin\win64 (this is for 64-bit Windows so choose the one for your version) and then paste it into msys64\tmp directory. This must be done as LGM exports the executable in that location and we need that DLL to be with the executable.
  3. Now run:
cd enigma-dev
./emake.exe -r CommandLine/testing/SimpleTests/steam_general.sog -e "DataStructures,GTest,Json,Steamworks" -o /tmp/test.exe

Steps To Run The Example (Ubuntu Linux 64-bit Only) (Working perfectly):

Note: You may have to edit paths provided in the below steps depending on where you cloned enigma-dev
  1. As Windows above but before running LGM, you must edit the .bashrc and add the two important exports mentioned above in the Linux section.
  2. Now open LGM and hit the run button
java -jar lateralgm.jar

Steps To Run The Example (Windows 64-bit Only) (Currently crashes):

Note: Windows support will be postponed due to an ABI issue as ENIGMA doesn't support MSVC yet, I recommend using Ubuntu Linux - 20/06/2023 00:45
Note: You may have to edit paths provided in the below steps depending on where you cloned enigma-dev
  1. Currently Steamworks and Json extensions are enabled by default in steam-sdk-integration branch so you need only Steam to be running. Don't forget to log in with your Steam account.

Important Changes To My Plan:

  • The final output of the project won't be a C++ wrapper for Steam SDK as declaimed in my proposal. A layer between Steamworks ENIGMA's extension and Steamworks API will be created instead.
  • Project structure has entirely changed.

Done Before Coding Period:

  • Started Implementing C++ wrapper.
  • Started Implementing General API.

User Functions Progress (EDL Scripts Implemented):

Management API

  • ✅ steam_init(); ✔️
  • ✅ steam_update();
  • ✅ steam_shutdown();

General API

  • ✅ steam_initialised(); ✔️
  • ✅ steam_stats_ready();
  • ✅ steam_get_app_id();
  • ✅ steam_get_user_account_id();
  • ✅ steam_get_user_steam_id();
  • ✅ steam_get_persona_name();
  • ✅ steam_get_user_persona_name();
  • ✅ steam_is_user_logged_on();
  • ✅ steam_current_game_language();
  • ✅ steam_available_languages();
  • ✅ steam_is_subscribed();
  • ✅ steam_set_warning_message_hook();

Overlay API

  • ✅ steam_is_overlay_enabled();
  • ✅ steam_is_overlay_activated();
  • ✅ steam_activate_overlay();
  • ✅ steam_activate_overlay_browser();
  • ✅ steam_activate_overlay_store();
  • ✅ steam_activate_overlay_user();
  • ✅ steam_set_overlay_notification_inset();
  • ✅ steam_set_overlay_notification_position();
  • OverlayType constant
  • OverlayNotificationPosition constant

enigma_steamworks_overlay_screen_1st_version_look


Stats & Achievements API

  • ✅ steam_set_achievement();
  • ✅ steam_get_achievement();
  • ✅ steam_clear_achievement();
  • ✅ steam_set_stat_int();
  • ✅ steam_set_stat_float();
  • ✅ steam_set_stat_avg_rate();
  • ✅ steam_get_stat_int();
  • ✅ steam_get_stat_float();
  • ⬜ steam_get_stat_avg_rate();
  • ✅ steam_reset_all_stats();
  • ✅ steam_reset_all_stats_achievements();

enigma_steamworks_stats_and_achievements_screen_1st_version_look


Leaderboards API

  • ✅ steam_create_leaderboard();
  • ✅ steam_upload_score();
  • ✅ steam_upload_score_ext();
  • ⬜ steam_upload_score_buffer();
  • ⬜ steam_upload_score_buffer_ext();
  • ✅ steam_download_scores();
  • ✅ steam_download_scores_around_user();
  • ✅ steam_download_friends_scores();
  • LeaderboardEntry data type
  • LeaderboardDisplayType constant
  • LeaderboardSortOrder constant

Must Be Done Before Merging:

✅ Adding support for other platforms in the Makefile file.
✅ Switching the Default property in the Steamworks & Json extensions YAML file to false.
✅ Switching the cxxflags property in Compilers/Linux/gcc.ey to -fdiagnostics-color=always.
⬜ Reviewing all error messages and documentation in newly added files.
✅ Adding the license to all newly added files.
✅ Providing installation instructions for all platforms.
✅ Modifying the extension to call steam_init(); automatically when enabled.
✅ Match all naming conventions with GMS's Steamworks extension.
⬜ Testing the APIs with the latest version of Steamworks SDK, Steam, OS version, etc.
⬜ Must test all EDL scripts in the example game provided.
⬜ Providing SOG/unit tests for all functions written (this needs to be studied carefully as in order to test the C++ wrapper tester must have steam installed and running or I may use mocks).
✅ Clearing garbage files.
DEBUG_MESSAGE() must exist only in APIs files. Try to remove it from wrapper files. Try to make the wrapper independent on ENIGMA.
✅ Fix example game background design.
⬜ Update the example game to match the latest version of GMS Steamworks extension.

✅ The compiler must write a file next to the exe.
⬜ Review includes.

⬜ Commit the example game again and remove it from .gitignore file.


Differences With GMS:

  1. steam_activate_overlay_user(); function
  • GMS:
steam_activate_overlay_user(string dialog_name, int64 steamid);
  • ENIGMA
steam_activate_overlay_user(int dialog, int64 steamid);
dialog constants:
 - user_ov_steamid
 - user_ov_chat
 - user_ov_jointrade
 - user_ov_stats
 - user_ov_achievements
 - user_ov_friendadd
 - user_ov_friendremove
 - user_ov_friendrequestaccept
 - user_ov_friendrequestignore
  1. steam_set_overlay_notification_inset();
  • GMS: Returns bool
  • ENIGMA: Returns void
  1. The user can set the maximum leaderboard entries to fetch using the user variable: lb_max_entries

Troubleshooting:

  1. If creating the steam_appid.txt file fails, just run the following commands for Linux:
cd /tmp
echo 480 > steam_appid.txt

For Windows:
Create a file steam_appid.txt and place it inside msys64\tmp directory. Don't forget to write 480 in that text file. IMPORTANT: This text file must be named steam_appid.txt and has 480 - which is the default App ID - inside it. Note: This file also must be placed with the executable.

  1. On Linux, if there is something wrong with the exports, try to check the location of the lib using
find ~ -name gameoverlayrenderer.so

@k0T0z k0T0z marked this pull request as draft June 3, 2023 02:46
@k0T0z k0T0z changed the title GSoC: Steam Workshop SDK/Third Party Integration GSoC Midterm Evaluation: Steam Workshop SDK/Third Party Integration Jun 4, 2023
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
…umntation is done

Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
@k0T0z k0T0z marked this pull request as ready for review July 26, 2023 18:35
@k0T0z k0T0z requested a review from RobertBColton July 26, 2023 18:35
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
@k0T0z
Copy link
Contributor Author

k0T0z commented Oct 1, 2023

@RobertBColton please remove GSoC-Done from this PR and add it to #2350.

@RobertBColton
Copy link
Contributor

Ok, I have done so.

RobertBColton added a commit that referenced this pull request Oct 11, 2023
)

Closes #1881. This is the second part of my first PR #2343.

This PR is part of the ``Google Summer of Code 2023`` program.

I will be updating my Logs inside my [domain](https://k0t0z.github.io).

#### Note: ✔️ means that SOG/unit tests for the
corresponding function are provided.


---------------------------------------------------------------------------------------------------

✅ [Leaderboards
API](https://github.com/YoYoGames/GMEXT-Steamworks/wiki/Leaderboards)
 - ✅ steam_create_leaderboard();
 - ✅ steam_upload_score();
 - ✅ steam_upload_score_ext();
 - ⬜ steam_upload_score_buffer();
 - ⬜ steam_upload_score_buffer_ext();
 - ✅ steam_download_scores();
 - ✅ steam_download_scores_around_user();
 - ✅ steam_download_friends_scores();
 - ⬜ ``LeaderboardEntry`` data type
 - ✅ ``LeaderboardDisplayType`` constant
 - ✅ ``LeaderboardSortOrder`` constant


---------------------------------------------------------------------------------------------------

✅ [Social
API](https://github.com/YoYoGames/GMEXT-Steamworks/wiki/Social)
 - ✅ steam_set_rich_presence();
 - ✅ steam_set_clear_presence();
 - ✅ steam_user_set_played_with();
 - ⬜ steam_get_friends_game_info();
 - ✅ steam_get_user_avatar();
 - ✅ steam_image_get_size();
 - ✅ steam_image_get_rgba();
 - ✅ steam_image_get_bgra();
 - ✅ steam_image_get_argb();
 - ✅ steam_image_create_sprite();


---------------------------------------------------------------------------------------------------

⬜ [Cloud
API](https://github.com/YoYoGames/GMEXT-Steamworks/wiki/Cloud)
 - ⬜ steam_is_cloud_enabled_for_app();
 - ⬜ steam_is_cloud_enabled_for_account();
 - ⬜ steam_get_quota_total();
 - ⬜ steam_get_quota_free();
 - ⬜ steam_file_exists();
 - ⬜ steam_file_size();
 - ⬜ steam_file_persisted();
 - ⬜ steam_file_write();
 - ⬜ steam_file_write_file();
 - ⬜ steam_file_read();
 - ⬜ steam_file_share();
 - ⬜ steam_file_delete();


---------------------------------------------------------------------------------------------------

## Must Be Done Before Merging:

✅ Adding support for other platforms in the Makefile
file.
✅ Switching the ``Default`` property in the Steamworks
& Json extensions YAML file to ``false``.
✅ Switching the ``cxxflags`` property in
``Compilers/Linux/gcc.ey`` to ``-fdiagnostics-color=always``.
⬜ Reviewing all error messages and documentation in
newly added files.
✅ Adding the license to all newly added files.
✅ Providing installation instructions for all
platforms.
✅ Modifying the extension to call ``steam_init();``
automatically when enabled.
✅ Match all naming conventions with GMS's Steamworks
extension.
⬜ Testing the APIs with the latest version of
Steamworks SDK, Steam, OS version, etc.
⬜ Must test all EDL scripts in the example game
provided.
⬜ Providing SOG/unit tests for all functions written
(this need to be studied carefully as in order to test the C++ wrapper
tester must have steam installed and running or I may use mocks).
✅ Clearing garbage files.
✅ ``DEBUG_MESSAGE()`` must exist only in APIs files.
Try to remove it from wrapper files. Try to make the wrapper independent
on ENIGMA.
✅ Fix example game background design.
⬜ Update the example game to match the latest version
of [GMS Steamworks
extension](https://marketplace.yoyogames.com/assets/10709/steamworks-ext).

:white_check_mark: The compiler must write a file next to the exe.
:white_large_square: Review includes.

:white_check_mark: Commit the example game again and remove it from
``.gitignore`` file.
:white_large_square: The extension and the example must be compatible
with GameMaker.
:white_large_square: Set the title for Steamworks demo to ``Created with
ENIGMA``.
:white_large_square: Monitor GMS's terminal behavior.


---------------------------------------------------------------------------------------------------

## Dependencies:

- [Social
API](https://github.com/YoYoGames/GMEXT-Steamworks/wiki/Social) depends
on this #2309 (#2361).


---------------------------------------------------------------------------------------------------

## Good to have:

:white_large_square: Test the changes with
[RGM](https://github.com/enigma-dev/RadialGM).
:white_large_square: Solve all build warnings.

---------

Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Co-authored-by: saifkandil <saifsaalaheldeen2002@gmail.com>
Co-authored-by: = <=>
Co-authored-by: --replace-all <--replace-all>
Co-authored-by: Robert Colton <robertbcolton@gmail.com>
@k0T0z k0T0z deleted the steam-sdk-integration branch October 12, 2023 08:20
JoshDreamland pushed a commit that referenced this pull request Mar 19, 2024
The next PR after #2350 and #2343.

This PR contains the following changes:

 1. Update SDK from v1.57 to v1.58a.
2. Improved the Shell Makefile (the part related to the Steamworks
extension).
- Moved building the fake API process inside a separate Makefile
specific to the fake API.
 3. Cleaned some comments including flushing the Steamworks Makefile.
 4. Fixed the README.md file.
 5. Improved documentation.
 6. Created a separate Makefile for the fake Steamworks API.
 7. Added v1.58a official headers.
 8. Fixed .gitignore file.

---------

Signed-off-by: Saif Kandil <74428638+k0T0z@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Steam Workshop SDK/Third Party Integration
2 participants