• Stars
    star
    206
  • Rank 190,504 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Bevy plugin for integrating with the Steamworks SDK

bevy-steamworks

crates.io Documentation License

This crate provides a Bevy plugin for integrating with the Steamworks SDK.

Installation

Add the following to your Cargo.toml:

[dependencies]
bevy-steamworks = "0.9"

The steamworks crate comes bundled with the redistributable dynamic libraries of a compatible version of the SDK. Currently it's v153a.

If you wish to enable serde support add the following:

[dependencies]
bevy-steamworks = { version = "0.9", features = ["serde"] }

Usage

To add the plugin to your app, simply add the SteamworksPlugin to your App. This will require the AppId provided to you by Valve for initialization.

use bevy::prelude::*;
use bevy_steamworks::*;

fn main() {
  // Use the demo Steam AppId for SpaceWar
  App::new()
      .add_plugins(DefaultPlugins)
      .add_plugins(SteamworksPlugin::new(AppId(480)))
      .run()
}

The plugin adds steamworks::Client as a Bevy ECS resource, which can be accessed like any other resource in Bevy. The client implements Send and Sync and can be used to make requests via the SDK from any of Bevy's threads. However, any asynchronous callbacks from Steam will only run on the main thread.

The plugin will automatically call SingleClient::run_callbacks on the Bevy main thread every frame in First, so there is no need to run it manually.

NOTE: If the plugin fails to initialize (i.e. Client::init() fails and returns an error, an error wil lbe logged (via bevy_log), but it will not panic. In this case, it may be necessary to use Option<Res<Client>> instead.

All callbacks are forwarded as Events and can be listened to in the a Bevy idiomatic way:

use bevy::prelude::*;
use bevy_steamworks::*;

fn steam_system(steam_client: Res<Client>) {
  for friend in steam_client.friends().get_friends(FriendFlags::IMMEDIATE) {
    println!("Friend: {:?} - {}({:?})", friend.id(), friend.name(), friend.state());
  }
}

fn main() {
  // Use the demo Steam AppId for SpaceWar
  App::new()
      .add_plugins(DefaultPlugins)
      .add_plugins(SteamworksPlugin::new(AppId(480)))
      .add_systems(Startup, steam_system)
      .run()
}

Bevy Version Supported

Bevy Version bevy_steamworks
0.12 0.9
0.11 0.8
0.10 0.7
0.9 0.6
0.8 0.5
0.7 0.4
0.6 0.2, 0.3
0.5 0.1

More Repositories

1

backroll-rs

A (almost) 100% pure safe Rust implementation of GGPO-style rollback netcode.
Rust
351
star
2

FantasyCrescendo

A 2.5D Touhou Platform Fighter, By the fans, for the fans.
C#
107
star
3

HouraiNetworking

Transport level library for peer-to-peer networking with multiple backends for the Unity.
C#
100
star
4

Discord-Game-SDK

A Unity Package Manager compatible version of the Discord Game SDK
C#
24
star
5

bevy_system_graph

Utilities for creating strictly ordered execution graphs of systems for the Bevy game engine.
Rust
24
star
6

Loadables

A Unity3D library for abstracting and simplifying loadable assets and scenes.
C#
23
star
7

HouraiOptions

Simplified and automatic game option creation for Unity3D games.
C#
18
star
8

HouraiLauncher

A cross platform launcher patching solution for video games.
Python
16
star
9

parallel_vec

A leaner structure of arrays implementation with a vec of tuples like public interface
Rust
13
star
10

FantasyCrescendoECS

An experimental port of FantasyCrescendo's systems to Unity's DOTS based ECS.
C#
12
star
11

FantasyCresendoBevy

An experimental, ground-up reimplementation of the core gameplay systems of Fantasy Crescendo in Bevy/Rust.
C++
9
star
12

HouraiLocalization

Localization system for Unity3D.
C#
9
star
13

Unity-Build-Scripts

Travis CI Build Scripts for Hourai Teahouse's Unity3D projects.
Shell
7
star
14

Tapioca

Efficient and cost effective continuous delivery for large binary games.
Go
7
star
15

HouraiConfig

A Unity3D system for effectively authoring and editing global game configurations without use of singletons
C#
6
star
16

bevy_prototype_animation

A preliminary prototype implementation of animation primitives for Bevy
Rust
6
star
17

HouraiLib

A general set of utility scripts used in Hourai Teahouse projects.
C#
5
star
18

houraiteahouse.net

HTML
5
star
19

HouraiOptions.UI

Automatic UI generation for game settings created with HouraiOptions.
C#
3
star
20

HouraiCore

A core utilities library underpinning most Hourai Teahouse projects in Unity 3D.
C#
3
star
21

HouraiSerialization

High performance binary message serialization for Unity 2018.3+.
C#
2
star
22

houraiteahouse.net-frontend

Front-end of http://houraiteahouse.net
JavaScript
2
star
23

FantasyCrescendoRedux

An Experimental Rewrite of Fantasy Crescendo from the ground up to support various types of net-enabled gameplay.
C#
2
star
24

houraiteahouse.github.io

Documentation site for Hourai Teahouse
HTML
1
star
25

GameConsole

C#
1
star
26

houraiteahouse.net-backend

The backend of http://houraiteahouse.net
Python
1
star
27

houraiteahouse.net-prod

The statically built website for Hourai Teahouse. Source code: https://github.com/HouraiTeahouse/houraiteahouse.net
HTML
1
star
28

HouraiDeploy

Webhook based deployment to a given host.
Python
1
star
29

houraiteahouse.net-functions

Google Cloud Functions running as a light backend for houraiteahouse.net
JavaScript
1
star
30

SmashBrew

A customizable engine for creating games similar to Nintendo's Super Smash Brothers series.
C#
1
star
31

KeyboardInputTest

A Unity3D project to debug keyboard input issues.
C#
1
star
32

houraiteahouse.net-test

The statically built test website for Hourai Teahouse. Source code: https://github.com/HouraiTeahouse/houraiteahouse.net
HTML
1
star
33

FantasyCrescendo-Old

Old Implementation of Fantasy Crescendo prior to 02/03/2018
C#
1
star