Steamworks Plus webview2/cef export companion addon

0 favourites
  • 7 posts
From the Asset Store
DATA+ (Addon Pack)
$18 USD
20% off
Data+ is the best Data Management solution for Construct 3. It contains 4 Addons (Plugin & Behavior).
  • I created a free open source addon Steamworks Plus as a companion addon to Ashley's nice new Steamworks addon https://www.construct.net/en/make-games/addons/1105/steamworks-webview2

    Right now it just adds a few features as proof of concept, but I hope it is a good framework to allow the community to expand the available Steamworks features with C3 and webview2. I added a few new ACEs to work with Steamworks leaderboards.

    I don't suggest using it for production yet, however I do invite addon devs in the community to help add to the functionality. I have some details on development on the github repo. It does require JS and C++ to add functionality, but with a little help from ChatGPT I was able to revive some of my old and moldy C++ skills to get it working, so you can too!

    Repo is here: github.com/MikalDev/cf_steamworks_plus

    PRs and collaborators welcome.

    A big thanks to Ashley for providing the source for the original addon, this companion addon was entirely based on the framework that he developed. I also want to thank Scirra for their philosophy of creating a nice JS SDK for addons and C++ addons for the wrapper. From looking at C3 addons, developing addons, looking at the C3 engine code, writing our game using the scripting interface with TS/JS I have sharpened and grown my dev skills. I appreciate the (controlled) access to the engine and the push to use new tech like webview2 and new web technology. As possible, I look forward to more documented SDK access, including more editor SDK access to add new features in editor too.

    Some notes:

    - Ashley, I welcome a review if I implemented this in the way you imagined. In general it is pretty straightforward, except for some of the data passing.

    - In terms of passing data between addon and wrapper, it looks like they are just 3 types, bool, number (double on wrapper side) and string. To pass more complicated data structures, so far I am passing a JSON string back from the wrapper.

    - Some of the commands require handles which cannot be passed back, so I keep them as statics in the wrapper (global now, but should be private in the class). Following command can use the handle to access further commands. For example set current leaderboard (gets handle and stores), update current leaderboard, uses previous handle.

    - I need to do more testing with using webview2 remote preview to make this development easier / smoother.

    - I need to figure out ways to debug the DLL.

  • Nice work! Happy to see a companion plugin in the works. It looks like you've used pretty much exactly the approach I intended.

    To pass more complicated data structures, so far I am passing a JSON string back from the wrapper.

    Yeah, I think that's the best solution. Passing complex data types over a DLL boundary gets very complicated, and JS already has built-in support for JSON, so just sending a string of JSON data is probably the best thing to do for more complex data types. If you need more advanced JSON support in C++ I can recommend this C++ JSON library.

    Some of the commands require handles which cannot be passed back, so I keep them as statics in the wrapper (global now, but should be private in the class).

    Yep, that's fine. If you need multiple handles you can do something like assign them tags and use the tags in the event system to identify the handle, and look them up on the C++ side.

    I need to figure out ways to debug the DLL.

    In Visual Studio, you can set the debug command to run the wrapper app executable. Then make sure the .ext.dll is a debug build of your DLL (just copy paste it over the exported files if necessary). Then when you click the debug run button in Visual Studio, it should start up the app, detect your debug DLL, and then stop on breakpoints you've set so you can properly debug it. (There's also OutputDebugString() and other debug output methods for a console-like output if that helps.)

    It should be possible to set up a workflow where Visual Studio builds the debug DLL directly over the WebView export, so you can change some C++ code, start debug, and it automatically builds, runs and then debugs your new code.

  • Thanks for the great tips Ashley - the JSON lib looks nice and I tried debugging with your suggestion, works nicely!

  • Updates:

    fix (leaderboard)

    add Error condition and Error data

    add IsDlcInstalled

  • 1.6.0 Add GetFriendPersonaName

  • 1.7.0

    Add very basic steamworks network messaging for testing. Requires correct SteamID to communicated between clients.

    To get the correct SteamID: In the Steam desktop application, select your Steam username in the top right corner of the screen. Select ''Account details''. Your Steam ID can be found below your Steam username.

    Networking must be enabled before communication. In the example project click on 'Enable Networking' this enables polling each tick for incoming messages.

    In the example app, the steamId should be added to the top box and the message to the other box (right now a random number is appended in the example project, easy to change.)

    When communication first happens between two clients, the receiving client must accept the connection before messages can be sent between them. The example project automatically accepts all incoming connections/sessions. Right now the channel number is hardwired to 0, but will change. Please try it out and let me know your experiences!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Added Linux CEF export support (Ubuntu 22, Steam Deck testing underway).

    construct.net/en/make-games/addons/1124/steamworks-plus

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)